package xyz.caijiwang.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import xyz.caijiwang.entity.Comment;
import xyz.caijiwang.entity.User;

import java.util.List;

@Mapper
@Repository
public interface CommentMapper {
    void deleteByPrimaryKey(Integer commentid,Integer userid);

    void deleteByParentId(Integer parentid,Integer userid);

    int insert(Comment record);

    int insertSelective(Comment record);

    Comment selectByPrimaryKey(Integer commentid);

    int updateByPrimaryKeySelective(Comment record);

    int updateByPrimaryKey(Comment record);

    List<Comment> selectCommentFatherByArticle(Integer articleid);

    List<Comment> selectCommentChildrenByParentid(Integer articleid);

    User getUserInfoByParentid(Integer parentid);
}